package com.surveillance.tests;

import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.surveillance.BO.BOLayer;
import com.surveillance.BO.SurveillantBO;
import com.surveillance.entities.Agenda;
import com.surveillance.entities.Enseignant;
import com.surveillance.entities.Examen;
import com.surveillance.entities.Matiere;
import com.surveillance.entities.Salle;
import com.surveillance.util.LoadBeans;

public class TestMatiere {
	public static void main(String[] args) {

		ApplicationContext appContext = new ClassPathXmlApplicationContext(
				"beanLocations.xml");
		BOLayer<Matiere> matiereBO = (BOLayer<Matiere>) appContext
				.getBean("MatiereBO");
		SurveillantBO survBo = (SurveillantBO) LoadBeans.getSurveillantBO();
		
		List<Matiere> fetchedMatiere = matiereBO.findAll();
		Enseignant ens = (Enseignant) survBo.findByID(new Long(13));
		for(int i=0; i<fetchedMatiere.size();i++){
			fetchedMatiere.get(i).setRespMatiere(ens);
			matiereBO.update(fetchedMatiere.get(i));
		}
				
	}

}
